# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=perl-libwww
pkgver=6.67
pkgrel=1
pkgdesc="The World-Wide Web library for Perl"
arch=('any')
url="https://metacpan.org/release/libwww-perl"
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-encode-locale' 'perl-file-listing'
         'perl-html-parser' 'perl-http-cookies' 'perl-http-daemon'
         'perl-http-date' 'perl-http-negotiate' 'perl-lwp-mediatypes'
         'perl-net-http' 'perl-try-tiny' 'perl-uri' 'perl-www-robotrules')
optdepends=('perl-lwp-protocol-https: for https:// url schemes')
checkdepends=('perl-test-fatal' 'perl-test-needs' 'perl-test-requiresinternet')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-$pkgver.tar.gz)
sha512sums=('0e0c148e7d7e29e813e880e18be63d86b04a1b74fa7862e988727d7a9e6497e17baa7a90f79608f4edb83552d468c8b9be0ea7562a3777d305ae8891a04e496e')

build() {
  cd libwww-perl-$pkgver
  perl Makefile.PL --aliases INSTALLDIRS=vendor
  make
}

check()  {
  cd libwww-perl-$pkgver
  make test
}

package() {
  cd libwww-perl-$pkgver
  make DESTDIR="$pkgdir" install
}
